package com.haoyu.number.LinkedList;

import java.util.Stack;

/**
 * @author 蒿雨
 * @create 2021-10-31 15:12
 * 演示栈Stack的基本使用
 */
public class TestStack {
    public static void main(String[] args) {
        Stack<String> stack = new Stack<>();
        //入栈
        stack.add("老大");
        stack.add("老二");
        stack.add("老三");
        //出栈
        while (stack.size()>0){
            System.out.println(stack.pop());
        }
    }
}
